package kuzha;

public class ErrorMessage {
	public final String filename;
	public final SourceLocation location;
	public final String message;
	
	public ErrorMessage(String filename, SourceLocation location, String message) {
		this.filename = filename;
		this.location = location;
		this.message = message;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		if (filename != null)
			sb.append(filename + ": ");
		if (location != null)
			sb.append(location + ": ");
		if (message != null)
			sb.append(message);
		return sb.toString();
	}
}
